// 实现由后序、中序序列构造二叉树的算法。
#include<iostream>
#include<fstream>
#include<string>
#include"BinaryTree.h"

using namespace std;

int main()
{
    fstream file;
    file.open("BiTreePost.txt",ios::in);
    string postOrderString;
    string midOrderString;
    file>>postOrderString;
    cout<<"postOrderString:"<<postOrderString<<endl;
    file>>midOrderString;
    cout<<"midOrderString:"<<midOrderString<<endl;
    file.close();
    BinaryTree * binarytree = new BinaryTree;
    binarytree->CreateBiTreePostIN(binarytree->root,postOrderString,midOrderString);
    cout<<"Start MidSearchi"<<endl;
    binarytree->MidSearchBiTree(binarytree->root);
    cout<<endl;
    cout<<"Is it a CompleteBinaryTree? "<<binarytree->JudgeComplete()<<endl;
    return 0;
}